Use SHA-256 for runtime telemetry package checksums#18846
Conversation
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR upgrades runtime telemetry package checksums from SHA-1 to SHA-256 across the jar analysis pipeline and its tests.
Changes:
- Switch checksum computation in
JarDetailsfrom SHA-1 to SHA-256 and adjust formatting to 64 hex chars. - Update
JarAnalyzeremitted attributes to report algorithm"SHA-256"and use the new SHA-256 checksum method. - Update related tests to validate SHA-256 output shape (64 lowercase hex characters).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| instrumentation/runtime-telemetry/testing/src/test/java/io/opentelemetry/javaagent/instrumentation/runtimetelemetry/JarDetailsTest.java | Updates assertions to validate SHA-256 checksum format. |
| instrumentation/runtime-telemetry/testing/src/test/java/io/opentelemetry/javaagent/instrumentation/runtimetelemetry/JarAnalyzerTest.java | Updates expected checksum algorithm and checksum format to SHA-256/64-hex. |
| instrumentation/runtime-telemetry/javaagent/src/test/java/io/opentelemetry/javaagent/instrumentation/runtimetelemetry/JarAnalyzerInstallerTest.java | Updates expected log attributes and checksum regex to SHA-256/64-hex. |
| instrumentation/runtime-telemetry/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/runtimetelemetry/JarDetails.java | Implements SHA-256 digest computation and exposes computeSha256(). |
| instrumentation/runtime-telemetry/javaagent/src/main/java/io/opentelemetry/javaagent/instrumentation/runtimetelemetry/JarAnalyzer.java | Emits SHA-256 checksum and algorithm attribute. |
| byte[] buffer = new byte[8192]; | ||
| while (dis.read(buffer) != -1) {} | ||
| byte[] digest = md.digest(); | ||
| return String.format(Locale.ROOT, "%040x", new BigInteger(1, digest)); | ||
| return String.format(Locale.ROOT, "%064x", new BigInteger(1, digest)); |
|
@jack-berg do you know whether anybody uses it and whether changing the hash algorithm would cause issues? |
I'm not sure if people are using it, but I believe the change is allowed by our VERSIONING.md policy since it's behind an experimental configuration flag ( |
|
I support changing. |
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
Signed-off-by: Israel Blancas <iblancasa@gmail.com>
…umentation into 18845
breedx-splk
left a comment
There was a problem hiding this comment.
I think 15 years is a long enough deprecation period. 🤣
…8846) Signed-off-by: Israel Blancas <iblancasa@gmail.com> Co-authored-by: jason plumb <75337021+breedx-splk@users.noreply.github.com>
Fixes #18845
This change updates runtime telemetry package checksums from SHA-1 to SHA-256. Some FIPS-enabled environments disallow SHA-1 for this use. Using SHA-256 makes runtime telemetry package checksum generation compatible with stricter cryptographic policies.
Changes: